package com.huike.clues.service.impl;


import com.huike.clues.domain.TbClue;
import com.huike.clues.domain.TbClueTrackRecord;
import com.huike.clues.domain.vo.ClueTrackRecordVo;
import com.huike.clues.mapper.TbClueMapper;
import com.huike.clues.mapper.TbClueTrackRecordMapper;
import com.huike.clues.service.ITbClueTrackRecordService;
import com.huike.common.core.domain.AjaxResult;
import com.huike.common.core.page.TableDataInfo;
import com.huike.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 线索跟进记录Service业务层处理
 * @date 2022-04-22
 */
@Service
public class TbClueTrackRecordServiceImpl implements ITbClueTrackRecordService {

    //注入mapper
    @Autowired
    private TbClueTrackRecordMapper tbClueTrackRecordMapper;

    @Autowired
    private TbClueMapper tbClueMapper;
    //查询线索跟进记录列表
   /* @Override
    public TableDataInfo list(Long clueId) {
        return null;
    }*/

    //新增线索跟进记录
    @Override
    @Transactional
    public void add(TbClueTrackRecord tbClueTrackRecord, TbClue tbClue) {
    //向线索跟进记录表保存记录
     tbClueTrackRecordMapper.insert(tbClueTrackRecord);
     //2.想线索表更新数据(已经提供)
      tbClueMapper.updateTbClue(tbClue);
    }

    //查询线索跟进记录列表
    @Override
    public List<TbClueTrackRecord> list(Long clueId) {
        return tbClueTrackRecordMapper.list(clueId);
    }
}
